﻿package com.gamemeal.filters {
	import flash.display.BitmapData;
	import flash.geom.Point;
	import flash.geom.Rectangle;
	
	import com.gamemeal.filters.ICustomBitmapFilter;
	/**
	 * @author Colin
	 */
	public class CustomFilterFloodFill extends ICustomBitmapFilter{
		private var origin:Point = new Point(0,0);

		public function apply(ctx:BitmapData):void{
			ctx.threshold(ctx, ctx.rect,origin,">",0xFF888888,0xFFFF0000);
			var rect : Rectangle = ctx.getColorBoundsRect(0xFFFFFF, 0xFF0000);
			ctx.fillRect(rect, 0xFF0000);
		}
	}
}
